package com.bilibili.demo;

import java.util.Scanner;

public class dayin {

    public void printallinfo(movie movies[]) {
        for(int i = 0 ; i < movies.length ; i++ ){
            System.out.println(movies[i].getID()+"\t"+movies[i].getname()+"\t"+movies[i].getprice()+"\t"+movies[i].getactor());
        }
    }

    public void seach(movie movies[]) {
        System.out.println("请输入查找电影的ID:");
        Scanner num = new Scanner(System.in);
        int n =num.nextInt() ;
    for (int i = 0 ; i < movies.length ; i++ ){
        movie m = movies[i] ;
            if(m.getID() == n ){
                System.out.println(movies[i].getID()+"\t"+movies[i].getname()+"\t"+movies[i].getprice()+"\t"+movies[i].getactor());
                return;
            }
        }
        System.out.println("没有找到该电影!!!");
    }
}
